//--------------------------------------------------------------
//
// Qizhi Zhang 
// ezhung@gmail.com
// http://www.moorwind.com
//
//--------------------------------------------------------------
package reader.controller
{
	import org.puremvc.as3.multicore.interfaces.ICommand;
	import org.puremvc.as3.multicore.interfaces.INotification;
	import org.puremvc.as3.multicore.patterns.command.SimpleCommand;
	
	import reader.ApplicationFacade;
	import reader.core.ReaderModelLocator;

	public class LoginOutCommand extends SimpleCommand implements ICommand
	{
		////////////////////////////////////////////////////////////////////////////////
		//private variables
		private var airReader:Reader;
		private var readerModelLocator:ReaderModelLocator = ReaderModelLocator.instance;
		
		//////////////////////////////////////////////////////////////////////////////
		//methods
		
		override public function execute(notification:INotification):void
		{
			airReader = notification.getBody() as Reader;
			readerModelLocator.clear();
			
			facade.removeCommand(ApplicationFacade.LABEL_CREATE);
			facade.removeCommand(ApplicationFacade.SUBSCRIBE_CREATE);
			facade.removeCommand(ApplicationFacade.RENAME_SUBSCRIBE);
			facade.removeCommand(ApplicationFacade.REMOVE_SUBSCRIBE);
			facade.removeCommand(ApplicationFacade.SEARCH_SUBSCRIBE);
			facade.removeCommand(ApplicationFacade.DELETE_ACCOUNT);
			//facade.removeProxy(readerModelLocator.sqliteProxyFactory.dataProxyName);
			//facade.removeProxy(readerModelLocator.sqliteProxyFactory.serviceProxyName);	
		}
		
	}
}